package br.biofoco.p2p.rpc.tcp;

import br.biofoco.p2p.rpc.EndPoint;
import br.biofoco.p2p.rpc.Protocol;

public class TcpEndPoint implements EndPoint {
	
	private final String address;
	private final int port;
	
	public TcpEndPoint(String address, int port) {
		this.address = address;
		this.port = port;
	}

	public String getAddress() {
		return address;
	}

	public int getPort() {
		return port;
	}
	
	@Override
	public String toString() {
		return Protocol.TCP + ":" + address.toString() + ":" + port; 
	}

	@Override
	public Protocol getProtocol() {
		return Protocol.TCP;
	}

}
